<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<script type="text/javascript" src="../../js/FillStatus.js"></script>
<script type="text/javascript" src="../../js/TaskFactory.js"></script>
<script type="text/javascript" src="../../js/FillTaskList.js"></script>

<div class="list-group">
  <a href="./readall.html" class="list-group-item active">
    Menus
  </a>
  <a href="#" class="list-group-item" data-toggle="modal" data-target="#myModal">
    <span class="glyphicon glyphicon-plus"></span> New job
  </a>
</div>


<div class="list-group">
	<a href="./cronPendingList.json" class="list-group-item active"> Pending tasks </a> <span
		id="dashboard-pendingtasks"> </span>
</div>

<div class="list-group">
	<a href="./cronTaskList.json" class="list-group-item active"> Current tasks </a> <span
		id="dashboard-currenttasks"> </span>
</div>

<form role="form" action="../view/create.html" method="get">


<!-- modal "new job" -->
<div class="modal fade" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">New Job</h4>
      </div>
      <div class="modal-body">
        
        
		  <div class="form-group">
		    <label for="inputJobName">Job name: </label>
		    <input type="text" class="form-control" id="inputJobName" name="jobName" placeholder="Enter a job name">
		  </div>
		  <div class="form-group">
		    <label for="inputJobHostDir">Host directory</label>
		    <input type="text" class="form-control" id="inputJobHostDir"  name="jobHostDir" placeholder="\\server\shared">
		  </div>
		
        
        
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Create job</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


</form>

<script>
jQuery(function() {
	new FillTaskList("./cronPendingList.json", "#dashboard-pendingtasks"); 
	
	new FillTaskList("./cronTaskList.json", "#dashboard-currenttasks");
	
});

	
</script>